package gc;/** * @Author: Beating Pupils * @Date: 2020/7/27 06:30 * @Description:  测试年轻代的gc情况 *  内存分配：堆10M，年轻代5M（eden4M，from0.5M，to0.5M），老年代5M *  -XX:NewSize=5242880 -XX:MaxNewSize=5242880 -XX:InitialHeapSize=10485760 -XX:MaxHeapSize=10485760 -XX:SurvivorRatio=8 -XX:PretenureSizeThreshold=10485760 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:gc.log */public class MinorGCTest {    public static void main(String[] args) {        byte[] arry1 = new byte[1024 * 1024];        arry1 = new byte[1024 * 1024];        arry1 = new byte[1024 * 1024];        arry1 = null;        byte[] arry2new = new byte[2 * 1024 * 1024];        System.out.println(111);    }}